<template>
  <div class="Home">
    <h2>Home</h2>
    <div>{{msg}}</div>
    <span @click="test">测试</span>
  </div>
</template>

<script>
export default {
  name: 'Home',
  data () {
    return {
      msg: 'Welcome to Home'
    }
  },
  methods: {
    test: function () {
      this.$http.get('/posts').then(res => {
        console.log(res)
      })
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
